package com.example.demo.huawei;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main44 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String s1 = sc.nextLine();
        String s33 = sc.nextLine();
        int k = Integer.parseInt(s33);

        String[] split = s.split("\\s");
        String[] split2 = s1.split("\\s");

        String s2 = split[0];
        int[] a1 = new int[Integer.parseInt(s2)];

        String s3 = split2[0];
        int[] a2 = new int[Integer.parseInt(s3)];
        for (int i = 1; i < split.length; i++) {
            a1[i - 1] = Integer.parseInt(split[i]);
        }

        for (int i = 1; i < split2.length; i++) {
            a2[i - 1] = Integer.parseInt(split2[i]);
        }

//        System.out.println(Arrays.toString(a1));
//        System.out.println(Arrays.toString(a2));
//        System.out.println((k));
        int min = min(a1, a2, k);
        System.out.println(min);
    }

    /**
     * 1、两数组 分别取一个构成一对元素
     * 2、总共取k对
     * 3、所有元素求和 去和的最小值
     * 注意：两对元素如果对于a1 a2下表君相同 视为同一对元素
     * <p>
     * 3 1 1 2
     * 3 1 2 3
     * 2
     * 输出 4
     */
    private static int min(int[] a1, int[] a2, int k) {
        int minSum = 0;
//        while (i < a1.length && j < a2.length) {
//
//            if (x < k) {
//                int m = a1[i];
//                int n = a2[j];
//                x++;
//
//            }
//        }
        List<Integer> list = new ArrayList<>();
        for (int item : a1) {
            for (int value : a2) {
                list.add(item + value);
            }
        }
        Collections.sort(list);

        for (int i = 0; i < k; i++) {
            minSum = minSum + list.get(i);
        }
        return minSum;
    }
}
